#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<assert.h>

char* my_strncpy(char* dest,const char* src, size_t num)
{
	char* set = dest;
	assert(src);
	while (num--)
	{
		*dest = *src;
		dest++;
		src++;
	}
	return set;

}

char* my_strncat(char* dest, const char* src, size_t num)
{
	assert(dest && src);
	char* set = dest;
	while (*dest != '\0')
	{
		dest++;
	}
	while (num--)
	{
		*dest++ = *src++;
	}
	return set;
}

void* my_memcpy(void* dest, const void* src, size_t num)
{
	assert(src);
	void* set = dest;
	while (num--)
	{
		*(char*)dest = *(char*)src;
		dest = (char*)dest + 1;
		src = (char*)src + 1;
	}
	return set;
}


int main()
{
	char arr1[20] = "abcdef";
	char arr2[20] = { 0 };
	char arr3[] = "bcdedfd";
	size_t num = 0;
	scanf("%zu", &num);
	/*my_strncpy(arr2, arr1, num);*/
	my_strncat(arr1, arr3, num);
	for (int i = 0;i < 6+num;i++)
	{
		printf("%c", arr1[i]);
	}

	return 0;
}
 